import sys
from PyQt5.QtCore import *


class OldGuyThread(QThread):
    signal = pyqtSignal(int, float, float)
    def __init__(self):
        super().__init__()

    def getList(self, EnemySetlist, oldguylist):
        self.EnemySetList = EnemySetlist
        self.oldguylist = oldguylist

    def run(self):
        for EnemySet in self.EnemySetList:
            for Enemy in EnemySet.EnemyList:
                if Enemy.isVisible():
                    for i in range(len(self.oldguylist)):
                        if self.oldguylist[i].isdeath == 0 and self.oldguylist[i].collidesWithItem(Enemy):
                            self.oldguylist[i].isdeath = 1
                            # self.signal.emit(i, self.oldguylist[i].mapToScene(0, 0).x(), self.oldguylist[i].mapToScene(0, 0).y())

    def pause(self):
        self._isPause = True

    def resume(self):
        self._isPause = False
